<script language="javascript" type="text/javascript">
    // add field materi
    var matNum = {$total_materi};
    function addMateri(mat){
        matNum ++;
        var row = '<div id="matNum'+matNum+'"><br /><input type="text" class="span8 input-append" name="materi[]" value="'+mat.add_materi.value+'" style="background-color: #F4F4F4;"/>'+
            '<span class="add-on">&nbsp;<input type="button" class="btn-mini" value="-" onclick="removeMateri('+matNum+');"/></span></div>';
        jQuery('#item-materi').append(row);
        mat.add_materi.value = '';
    }
    // remove field materi
    function removeMateri(rnum) {
        jQuery('#matNum'+rnum).remove();
    }
    
    // add field indikator
    var indNum = {$total_indikator};
    function addIndikator(ind){
        indNum++;
        var row = '<div id="indNum'+indNum+'"><br /><input type="text" class="span8 input-append" name="indikator[]" value="'+ind.add_indikator.value+'" style="background-color: #F4F4F4;"/>'+
            '<span class="add-on">&nbsp;<input type="button" class="btn-mini" value="-" onclick="removeIndikator('+indNum+');"/></span></div>';
        jQuery('#item-indikator').append(row);
        ind.add_indikator.value = '';
    }
    // remove field indikator
    function removeIndikator(rnum) {
        jQuery('#indNum'+rnum).remove();
    }
    
    // add field sumber
    var sumNum = {$total_sumber};
    function addSumber(sum){
        sumNum++;
        var row = '<div id="sumNum'+sumNum+'"><br /><input type="text" class="span8 input-append" name="sumber[]" value="'+sum.add_sumber.value+'" style="background-color: #F4F4F4;"/>'+
            '<span class="add-on">&nbsp;<input type="button" class="btn-mini" value="-" onclick="removeSumber('+sumNum+');"/></span></div>';
        jQuery('#item-sumber').append(row);
        sum.add_sumber.value = '';
    }
    // remove field sumber
    function removeSumber(rnum) {
        jQuery('#sumNum'+rnum).remove();
    }
</script>